package com.web.java0327mybatisplus.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

/**
 * 员工实体类
 */
//@Data 自动添加get/set和toString方法
//@Data
//配置表名
@TableName("employee")
////@AllArgsConstructor 带所有参数的构造方法
//@AllArgsConstructor
////无参构造方法
//@NoArgsConstructor
public class Employee {

    //配置主键 type主键生成策略 AUTO 自动递增 INPUT 手动输入
    @TableId(type = IdType.AUTO)
    private Integer id;

    private String name;
    private Integer age;
    private String gender;
    private String position;
    private Integer departmentId;

    @TableLogic
    private Integer deleted;

    public Employee(Integer id, String name, Integer age, String gender, String position, Integer departmentId) {
        this.id = id;
        this.name = name;
        this.age = age;
        this.gender = gender;
        this.position = position;
        this.departmentId = departmentId;
    }

    public Employee() {
    }

    public Integer getDeleted() {
        return deleted;
    }

    public void setDeleted(Integer deleted) {
        this.deleted = deleted;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getPosition() {
        return position;
    }

    public void setPosition(String position) {
        this.position = position;
    }

    public Integer getDepartmentId() {
        return departmentId;
    }

    public void setDepartmentId(Integer departmentId) {
        this.departmentId = departmentId;
    }

    @Override
    public String toString() {
        return "Employee{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", age=" + age +
                ", gender='" + gender + '\'' +
                ", position='" + position + '\'' +
                ", departmentId=" + departmentId +
                '}';
    }
}
